#删除链表中等于给定值 val 的所有节点。
class Node():
    def __init__(self,val=0,n=None):
        self.val=val
        self.next=n

#定义链表

n1=Node(val=1)
n2=Node(val=2)
n3=Node(val=6)
n4=Node(val=3)
n5=Node(val=4)
n6=Node(val=5)
n7=Node(val=6)


n1.next=n2
n2.next=n3
n3.next=n4
n4.next=n5
n5.next=n6
n6.next=n7




def leecode203(node,target):
    temp=Node(val=0)
    temp.next=node
    prev = temp
    while node is not None:
        if node.val==target:
            prev.next=node.next
        prev=node
        node=node.next
    return temp.next


leecode203(n1,6)



# prev=temp
# def leecode206(node,target):
#         while node is not None and